import { basePrefix } from "@/config";
import crypto from "@/utils/crypto";
import request from "../axios";
export const getList = (current, size, params) => {
    return request({
        url: basePrefix + "/db/list",
        method: "get",
        params: {
            ...params,
            current,
            size
        }
    });
};

export const getDetail = (id) => {
    return request({
        url: basePrefix + "/db/detail",
        method: "get",
        params: {
            id
        }
    });
};

export const remove = (ids) => {
    return request({
        url: basePrefix + "/db/remove",
        method: "post",
        params: {
            ids
        }
    });
};

export const add = (row) => {
    return request({
        url: basePrefix + "/db/submit",
        method: "post",
        data: row
    });
};

export const update = (row) => {
    return request({
        url: basePrefix + "/db/submit",
        method: "post",
        data: row
    });
};
export const dynamicSql = (data, compId) => {
    return request({
        url: basePrefix + "/db/dynamic-query",
        method: "post",
        headers: {
            "Content-Type": "application/json"
        },
        params: {
            id: compId
        },
        data: data
    });
};
export const dbTest = (data) => {
    return request({
        url: basePrefix + "/db/db-test",
        method: "post",
        headers: {
            "Content-Type": "application/json"
        },
        data: data
    });
};
